<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<?php
include('../resource/menu.php');
include('../resource/config.php'); 
include('../resource/phpqrcode/qrlib.php');

if (isset($_GET['IDCT']) ) { 
$IDCT = (int) $_GET['IDCT']; 
$row = mysql_fetch_array ( mysql_query("SELECT * FROM `regcon` WHERE `IDCT` = '$IDCT' ")); 

$sexo="";
if($row['SECT']=="M")
	$sexo="Masculino";
if($row['SECT']=="F")
	$sexo="Femenino";

?>
<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		
        <link href="../resource/responsive/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="../resource/responsive/bootstrap-responsive.min.css" rel="stylesheet">
        <script src="../resource/responsive/jquery.min.js"></script>
        <script src="../resource/responsive/bootstrap.min.js"></script>

	</head>
	<body>
		 	<div id="navbar"></div>

			<div id="verde" class="span9">
    			<div class="hero-unit">
    				<?php if($row['NOCT']!="") 
						echo "<p><b>Nombre:</b><br /> ".$row['NOCT'];
					if($sexo!="") 
						echo "<p><b>Sexo:</b><br />".$sexo;
					if($row['TEC1']!="")
						echo "<p><b>Tel fijo:</b><br />".$row['TEC1']; 
					if($row['TEC2']!="")
						echo "<p><b>Tel movil:</b><br />".$row['TEC2'];
					if($row['COEL']!="")
						echo "<p><b>Correo:</b><br />".$row['COEL'];
					if($row['OBSE']!="")
						echo "<p><b>Observación:</b><br />".$row['OBSE'];
						
						$file = '../qr/'.$row['IDCT'].".png"; 
						if(file_exists($file))
							unlink($file);
						//$data = "Nombre: ".$row['NOCT']."\n Sexo: ".$sexo."\n Tel Fijo".$row['TEC1']."\n Tel Movil".$row['TEC2']."\n Correo".$row['COEL']."\n Observación: ".$row['OBSE'];

						$vcard="BEGIN:VCARD
VERSION:3.0
FN:".$row['NOCT']."
TEL;TYPE=WORK:".$row['TEC1']."
TEL;TYPE=CELL:".$row['TEC2']."
EMAIL;TYPE=PREF,INTERNET:".$row['COEL']."
NOTE:".$row['OBSE']."
NOTE:".$sexo."
END:VCARD";

						// El tamaño de la imagen.
						$size = 10; 
						// Capacidad de corrección de errores.
						$level = QR_ECLEVEL_H; 

						QRcode::png($vcard, $file, $level, $size);
						?>
						<p><b>QR:</b><br />
						<img class="aligncenter size-full wp-image-1921" title="qr" src="<?php echo $file; ?>" width="280" height="280">
						<div class="span4">
					      <div class="alert alert-info">
					        <a href='listar.php'>Volver a la lista</a>
					      </div>
					    </div>
				</div>
			</div>
	</body>
</html>
<?php } ?> 